#include <iostream>
#include <string>
#include <sstream>
using namespace std;

class Date
{
private:
    int Day, Month, Year;
    string datestring;
public:
    Date(int inputDay, int inputMonth, int inputYear):Day(inputDay),Month(inputMonth),Year(inputYear)
    {

    }
    Date& operator ++()
    {
        Day++;
        return *this;
    }
    Date& operator -- ()
    {
        Day--;
        return *this;
    }

    operator const char*() //返回字符串指针
    {
        //整转字符串
        ostringstream mydate;
        mydate << Year << "-" << Month << "-" << Day;
        datestring = mydate.str();
        return datestring.c_str();
    }

    void DisplayDate(void)
    {
        cout << Year << "-" << Month << "-" << Day << endl;
    }
};

int main(int argc, char const *argv[])
{
    Date Holiday(6,4,2017);
    // Holiday.DisplayDate();
    /*cout << Holiday << endl;*/
    string strHoliday(Holiday);
    cout << strHoliday << endl;
    return 0;
}
